using System;
using System.Windows.Forms;
using VideoAutoGenerator.Core;
using VideoAutoGenerator.UI.Forms;

namespace VideoAutoGenerator
{
    internal static class Program
    {
        /// <summary>
        ///  The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            
            // Test configuration system
            TestConfigurationSystem();
            
            Application.Run(new MainForm());
        }
        
        static void TestConfigurationSystem()
        {
            try
            {
                var config = ConfigManager.Instance;
                
                // Test reading a value
                var title = config.GetString("title");
                Console.WriteLine($"Current title: {title}");
                
                // Test setting and saving a value
                config.SetValue("testValue", "Test Configuration Value");
                config.SaveConfig();
                
                // Verify the value was saved
                var testValue = config.GetString("testValue");
                Console.WriteLine($"Test value: {testValue}");
                
                // Remove test value
                config.SetValue("testValue", null);
                config.SaveConfig();
                
                Console.WriteLine("Configuration system test completed successfully.");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Configuration system test failed: {ex.Message}");
            }
        }
    }
}